package com.scapegoat.pay.account.service.dao.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Repository;
import com.scapegoat.pay.common.core.dao.impl.BaseDaoImpl;
import com.scapegoat.pay.common.core.enums.PublicStatusEnum;
import com.scapegoat.pay.account.service.dao.RpAccountDao;
import com.scapegoat.pay.account.service.entity.RpAccount;


/**
 * 账户dao实现类
 *
 * @author walkman
 * @date 2017年10月17日 21:21:17
 */
@Repository
public class RpAccountDaoImpl extends BaseDaoImpl<RpAccount> implements RpAccountDao {
    
    public RpAccount getByAccountNo(String accountNo) {
        Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("accountNo", accountNo);
        paramMap.put("status", PublicStatusEnum.ACTIVE.name());
        return this.getBy(paramMap);
    }

    public RpAccount getByUserNo(Map<String, Object> map) {
        return this.getSessionTemplate().selectOne(getStatement("getByUserNo"), map);
    }
}